<?php

if (!defined('IN_XLP')) {
    exit('Access Denied!');
}

/**
 * Description of indexAction
 *
 * @author xlp
 */
class serviceAction extends commonAction {

    function __construct() {
        parent::__construct();
        //获取游戏数据
        parent::_initHeader();
    }

    /*
     * 关于我们
     */
    function about() {
      $content = D('article')->where(array('cid' => 1 , 'status' => 1))->order('infotime DESC')->find();
      $this->assign('data' , $content);
    	$this->display();
    }


    /*
     * 联系我们
     */
    function contact() {
      $content = D('article')->where(array('cid' => 2 , 'status' => 1))->order('infotime DESC')->find();
      $this->assign('data' , $content);
      $this->display();
    }


    /*
     * 网站公告
     */
    function notice() {
      $list = D('article')->where(array('cid' => 3 , 'status' => 1))->order('infotime DESC')->findAll();
      $this->assign('list' , $list);
      $this->display();
    }

    /*
     * 公告详情
     */
    function notice_detail() {
        $id = $this->_getid('id' , 0);
        if(!$id) {
            showError('参数丢失');
        }
        $info = D('article')->where(array('id'=>$id))->find();
        if(!$info) {
            showError('内容不存在');
        }
        $this->assign('info' , $info);
        $this->display();
    }

    /*
     * 广告服务
     */
    function advert() {
      $content = D('article')->where(array('cid' => 4 , 'status' => 1))->order('infotime DESC')->find();
      $this->assign('data' , $content);
      $this->display();
    }


    /*
     * 友情链接
     */
    function link() {
      $this->display();
    }


    /*
     * 手续费一览
     */
    function charge() {
      $list = D('article')->where(array('cid' => 5 , 'status' => 1))->order('infotime DESC')->findAll();
      $this->assign('list' , $list);
      $this->display();
    }

    /*
     * 手续费详情
     */
    function charge_detail() {
        $id = $this->_getid('id' , 0);
        if(!$id) {
            showError('参数丢失');
        }
        $info = D('article')->where(array('id'=>$id))->find();
        if(!$info) {
            showError('内容不存在');
        }
        $this->assign('info' , $info);
        $this->display();
    }


    /*
     *  最新活动 
     */
    function active() {
      $list = D('article')->where(array('cid' => 6 , 'status' => 1))->order('infotime DESC')->findAll();
      $this->assign('list' , $list);
      $this->display();
    }

    /*
     * 最新活动详情
     */
    function active_detail() {
        $id = $this->_getid('id' , 0);
        if(!$id) {
            showError('参数丢失');
        }
        $info = D('article')->where(array('id'=>$id))->find();
        if(!$info) {
            showError('内容不存在');
        }
        $this->assign('info' , $info);
        $this->display();
    }

}
